/*
 * Filename : SOCException.java 
 * Package : com.spi.soconversion
 * Created by: Software Paradigms International Group, LLC. (SPI) 
 * Copyright (c) 2010 HBC
 */

package com.spi.soconversion.base;

/**
 * This class defines the exception class used in Sales Order Conversion Application.
 * It wraps the exception and the message to report the cause of exception or
 * the point where exception occurred.
 * <p>
 * Issues:
 * <p>
 * NONE
 * <p>
 * History:
 * <p>
 * <ul>
 * <li>2010.04.17 pk: created
 * </ul>
 *
 * @author Priya Khanna, SPI (pk)
 */

public class SOCException extends Exception {

	/**
	 * Version number used during serialization/deserialization.
	 */
	private static final long serialVersionUID = 1L;
	
	/**
	 * Holds the reference to the throwable 
	 */
	private Throwable d_ex = null;

	/**
	 * Default constructor for SOCException class.
	 *
	 */
	public SOCException()
	{
		super();
	}

	/**
	 * Constructor with string message as an argument for SOCException class.
	 * @param str - message to be wrapped in Exception class
	 */
	public SOCException(String str)
	{
		super(str);
	}

	/**
	 * Constructor with wrapper message and throwable as arguments 
	 * for SOCException class.
	 * @param str - message to be wrapped in the exception class
	 * @param th - throwable exception
	 */
	public SOCException(String str, Throwable th)
	{
		super(str);
		d_ex = th;
	}

	/**
	* This method returns the exception / throwable wrapped in the SOCException.
	* @return throwable - the exception wrapped in the SOCException.
	* <em>Null<em> will be returned if the exception wraps the message alone 
	*/
	public Throwable getException()
	{
		return d_ex;
	}
}

